﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wfManaAddr.aspx.cs" Inherits="msBsc.WebUi.wfManaAddr" %>

<!DOCTYPE HTML>
<html>
<head id="Head1" runat="server">
    <title>收货地址管理</title>
    <link rel="shortcut icon" href="/themes/Style1/Image/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/??themes/Style1/StyleQt.css,themes/Style1/address.css" />
    <script src="/??jqPlugin/js/jquery-1.8.3.min.js,js/jBase.js,js/jBPage.js,themes/Style1/jsQt.js"
        type="text/javascript"></script>
    <!--head fix rgn-->
    <script type="text/javascript">
        $(window).load(function () {

            $("#dplPROVINCE_ID").change(function () {
                var _jsParam = new jsonRow();
                _jsParam.AddCell("ACTION", "dplPROVINCE_ID_change");
                _jsParam.AddCell("PROVINCE_ID", $(this).val());
                ajaxComm(_jsParam);
            });
            $("#dplCITY_ID").change(function () {
                var _jsParam = new jsonRow();
                _jsParam.AddCell("ACTION", "dplCITY_ID_change");
                _jsParam.AddCell("CITY_ID", $(this).val());
                ajaxComm(_jsParam);
            }); 
            $.ploadFile("laytpl", function (script, textStatus) { 
                loadlist();
            });
            $.ploadFile("layer", function (script, textStatus) {
            });
            setAllValiInp(); 
        });

        $(function () {
            $(".thead-tbl-address").live("mouseover", function () { $(this).addClass("address-hover").find(".implicit").removeClass("hide"); }).live("mouseout", function () { $(this).removeClass("address-hover").find(".implicit").removeClass("hide").addClass("hide"); });
        });
        function doSave() {
            if (getAllValiInp()) {
                var _jsParam = new jsonRow();
                var _jsPost = new jsonRow();
                GetFormJson("J_FormBox", _jsPost);
                _jsParam.AddCell("ACTION", "doSave");
                _jsPost.AddCell("ZONE_DESC", $("#dplPROVINCE_ID").find("option:selected").text() + " " + $("#dplCITY_ID").find("option:selected").text() + " " + $("#dplAREA_ID").find("option:selected").text());
                ajaxComm(_jsParam, _jsPost);
            }
        };

        function loadlist() {
            var _jsParam = new jsonRow();
            _jsParam.AddCell("ACTION", "loadlist");
            ajaxComm(_jsParam);
        };
        function doAddNew(sId) {
            $("#J_DeliverTitle").html("新增收货地址");
            SetCEmpty("J_FormBox");
        };
        function doedit(sId) {
            var _jsParam = new jsonRow();
            _jsParam.AddCell("ACTION", "doedit");
            _jsParam.AddCell("ID", sId);
            ajaxComm(_jsParam);
            $("#J_DeliverTitle").html("修改收货地址");
        };
        function dodelete(sId) {
            var _jsParam = new jsonRow();
            _jsParam.AddCell("ACTION", "dodelete");
            _jsParam.AddCell("ID", sId);
            ajaxComm(_jsParam);
        };
        function dosetdefault(sId) {
            var _jsParam = new jsonRow();
            _jsParam.AddCell("ACTION", "dosetdefault");
            _jsParam.AddCell("ID", sId);
            ajaxComm(_jsParam);
        };
    </script> 
</head>
<body>
    <div id="mallPage" class="tms-page mallAct tmall-  page-not-market">
        <!-- -->
        <!--商城通用顶通-->
        <%=new msBsc.WebUi.Code.QtHtmlGet().GetHeaderTopHtml()%>
        <%=new msBsc.WebUi.Code.QtHtmlGet().GetHeaderLogoHtml("会员中心")%>
        <div id="content" class="content" style=" padding-top: 3px;">
            <div class="page lang-zh-S">
                <div id="mytaobao-panel" class="grid-c2">
                    <div class="col-main" id="J_Col_Main" style="padding-bottom: 0;">
                        <div class="bought">
                            <div class="main-wrap" style=" background-color:#fff; padding:3px;">
                                <h2 class="h2-single">
                                    <span class="entity" id="J_DeliverTitle">收货地址详细信息</span></h2> 
                                <div class="form-box" id="J_FormBox"> 
                                    <div class="item item-title">
                                        <span class="item-label">提示： </span>电话号码、手机号选填一项,其余均为必填项
                                    </div>
                                    <div class="item " id="J_ItemDivision">
                                        <span class="item-label">所在地区：<i>*</i></span>
                                        <table border="0" cellpadding="0" cellspacing="0"><tr><td>
                                        <select name="dplPROVINCE_ID" id="dplPROVINCE_ID" class="comSel" style="width: 100px;">
                                        </select></td><td>
                                        -</td><td>
                                        <select name="dplCITY_ID" id="dplCITY_ID" class="comSel" style="width: 100px;">
                                        </select></td><td>
                                        -</td><td>
                                        <select name="dplAREA_ID" id="dplAREA_ID" class="comSel vali-inp" style="width: 100px;">
                                        </select></td></tr></table>
                                    </div>
                                    <div class="item " id="J_ItemStreet">
                                        <span class="item-label">详细地址：<i>*</i></span>
                                        <div class="ks-combobox" id="J_ComboboxStreet">
                                            <div class="ks-combobox-input-wrap">
                                                      <textarea class="ks-combobox-input i-ta vali-inp" id="txtSTREET_ADDRESS" class=" vali-inp" reg-exp="^([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9#]){5,120}$" right-msg="允许5-120个字符，可用中文、数字、字母、#！"></textarea>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="item" id="J_ItemPostCode">
                                        <span class="item-label">邮政编码：<i>*</i></span>
                                           <input id="txtZIP_CODE" class="i-text vali-inp" type="text" value="" reg-exp="^[0-9]{6}$" right-msg="请填写6位数字" >
                                  </div>
                                    <div class="item item-name" id="J_ItemName">
                                        <span class="item-label">收货人姓名：<i>*</i></span>
                                                 <input class="i-text vali-inp" type="text" id="txtRECEIPT_NME" value=""  reg-exp="^([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z]){2,15}$" right-msg="允许2-16个字符，可用中文、字母！"/>
                                    </div>
                                    <div class="item item-mobile" id="J_ItemMobile">
                                        <span class="item-label">手机号码：</span>
                                        <input class="i-text vali-inp" type="text" id="txtPHONE_NO" value=""  reg-exp="^\s*$|^1[0-9]{10}$" right-msg="请填写11位数字" />
                                    </div>
                                    <div class="item item-phone" id="J_ItemPhone">
                                        <span class="item-label">区号-座机-分机：</span>
                                        <table border="0" cellpadding="0" cellspacing="0"><tr><td>
                                        <input class="i-text i-text-short vali-inp" id="txtAREA_CODE" type="text" value=""  reg-targ="txtEXTENSION_NO" reg-exp="^\s*$|[0-9]{3,4}$" right-msg="请填写正确的区号"/></td><td>
                                        -</td><td>
                                        <input class="i-text i-text-short vali-inp" id="txtLANDLINE_NO" type="text" value=""   reg-targ="txtEXTENSION_NO" reg-exp="^\s*$|[0-9]{7,18}$" right-msg="请填写正确的座机号码"/></td><td>
                                        -</td><td>
                                        <input class="i-text i-text-short vali-inp" id="txtEXTENSION_NO" type="text" value=""   reg-targ="txtEXTENSION_NO" reg-exp="^\s*$|[0-9]{3,8}$" right-msg="请填写正确的分机号码"/></td></tr></table>
                                    </div>
                                    <div class="item item-set-default" id="j_ItemSetDefault">
                                        <input type="checkbox" class="i-chk" id="ckbIS_DEFAULT" />
                                        <label for="J_SetDefault">
                                            设置为默认收货地址</label>
                                    </div>
                                    <div class="item">
                                        <button type="button" class="btn" onclick="doAddNew();">
                                            新地址</button> 
                                        <button type="button" class="btn" onclick="doSave();" style=" margin-left:10px;">
                                            保存</button>
                                    </div>
                                    <input id="txtRECE_ADDRESS_ID" type="text" value="" style="display: none;" />
                                </div>
                                <h2 class="h2-single">
                                    <span class="entity">收货地址列表</span></h2> 
                                <div class="tbl-deliver-address"> 
                                    <div id="loadlist">
                                    </div>
                                    <%--              <table border="0" cellspacing="0" cellpadding="0" class="tbl-main">
                                    <colgroup>
                                        <col class="col-man">
                                        <col class="col-area">
                                        <col class="col-address">
                                        <col class="col-postcode">
                                        <col class="col-phone">
                                        <col class="col-actions">
                                    </colgroup>
                                    <tbody id="listtbody">
                                        <tr class="thead-tbl-grade">
                                            <th>
                                                收货人
                                            </th>
                                            <th>
                                                所在地区
                                            </th>
                                            <th>
                                                详细地址
                                            </th>
                                            <th>
                                                邮编
                                            </th>
                                            <th>
                                                电话/手机
                                            </th>
                                            <th>
                                                操作
                                            </th>
                                            <th>
                                            </th>
                                        </tr>
                                        <tr class="thead-tbl-address">
                                            <td>
                                                杨霞
                                            </td>
                                            <td>
                                                重庆 重庆市 九龙坡区
                                            </td>
                                            <td>
                                                重庆市九龙坡区二郎同天观云邸15-24-1
                                            </td>
                                            <td>
                                                400000
                                            </td>
                                            <td>
                                                15102340163
                                            </td>
                                            <td>
                                                <a href="/member/fresh/deliver_address.htm?addrId=1848720293">修改</a> | <a href="/member/fresh/deliver_address.htm?type=home&amp;action=deliver_address_mgr&amp;_tb_token_=ikerv29ISLhu&amp;event_submit_do_delete_in_fresh=submit&amp;id=1848720293"
                                                    class="del">删除</a>
                                            </td>
                                            <td class="thead-tbl-status">
                                                <a class="note implicit hide" href="/member/fresh/deliver_address.htm?type=home&amp;action=deliver_address_mgr&amp;_tb_token_=ikerv29ISLhu&amp;event_submit_do_update_default_addr=submit&amp;id=1848720293">
                                                    设为默认</a>
                                            </td>
                                        </tr>
                                        <tr class="thead-tbl-address">
                                            <td>
                                                张帮华
                                            </td>
                                            <td>
                                                重庆 重庆市 沙坪坝区
                                            </td>
                                            <td>
                                                下土湾路188号千竹景苑C1-5-2
                                            </td>
                                            <td>
                                                400000
                                            </td>
                                            <td>
                                                023-65408531
                                                <br>
                                                13330280020
                                            </td>
                                            <td>
                                                <a href="/member/fresh/deliver_address.htm?addrId=306871042">修改</a> | <a href="/member/fresh/deliver_address.htm?type=home&amp;action=deliver_address_mgr&amp;_tb_token_=ikerv29ISLhu&amp;event_submit_do_delete_in_fresh=submit&amp;id=306871042"
                                                    class="del">删除</a>
                                            </td>
                                            <td class="thead-tbl-status">
                                                <a class="note implicit hide" href="/member/fresh/deliver_address.htm?type=home&amp;action=deliver_address_mgr&amp;_tb_token_=ikerv29ISLhu&amp;event_submit_do_update_default_addr=submit&amp;id=306871042">
                                                    设为默认</a>
                                            </td>
                                        </tr>
                                        <tr class="thead-tbl-address  address-default">
                                            <td>
                                                张帮华
                                            </td>
                                            <td>
                                                重庆 重庆市 沙坪坝区 小龙坎街道
                                            </td>
                                            <td>
                                                千竹景苑C1-5-2
                                            </td>
                                            <td>
                                                400020
                                            </td>
                                            <td>
                                                13330280020
                                            </td>
                                            <td>
                                                <a href="/member/fresh/deliver_address.htm?addrId=1665770203">修改</a> | <a href="/member/fresh/deliver_address.htm?type=home&amp;action=deliver_address_mgr&amp;_tb_token_=ikerv29ISLhu&amp;event_submit_do_delete_in_fresh=submit&amp;id=1665770203"
                                                    class="del">删除</a>
                                            </td>
                                            <td class="thead-tbl-status">
                                                <span class="note">默认地址</span>
                                            </td>
                                        </tr>
                                        <tr class="thead-tbl-address">
                                            <td>
                                                杨霞
                                            </td>
                                            <td>
                                                重庆 重庆市 九龙坡区
                                            </td>
                                            <td>
                                                九龙坡区二郎老顶坡摩配市场6-15
                                            </td>
                                            <td>
                                                400039
                                            </td>
                                            <td>
                                                023-68196027
                                                <br>
                                                15102340163
                                            </td>
                                            <td>
                                                <a href="/member/fresh/deliver_address.htm?addrId=718337347">修改</a> | <a href="/member/fresh/deliver_address.htm?type=home&amp;action=deliver_address_mgr&amp;_tb_token_=ikerv29ISLhu&amp;event_submit_do_delete_in_fresh=submit&amp;id=718337347"
                                                    class="del">删除</a>
                                            </td>
                                            <td class="thead-tbl-status">
                                                <a class="note implicit hide" href="/member/fresh/deliver_address.htm?type=home&amp;action=deliver_address_mgr&amp;_tb_token_=ikerv29ISLhu&amp;event_submit_do_update_default_addr=submit&amp;id=718337347">
                                                    设为默认</a>
                                            </td>
                                        </tr>
                                        <tr class="thead-tbl-address">
                                            <td>
                                                陆小兵
                                            </td>
                                            <td>
                                                上海 上海市 虹口区
                                            </td>
                                            <td>
                                                海宁路137号上海民生公司7楼信息部陆小兵
                                            </td>
                                            <td>
                                                400000
                                            </td>
                                            <td>
                                                021-63071589
                                                <br>
                                                13370737883
                                            </td>
                                            <td>
                                                <a href="/member/fresh/deliver_address.htm?addrId=302440988">修改</a> | <a href="/member/fresh/deliver_address.htm?type=home&amp;action=deliver_address_mgr&amp;_tb_token_=ikerv29ISLhu&amp;event_submit_do_delete_in_fresh=submit&amp;id=302440988"
                                                    class="del">删除</a>
                                            </td>
                                            <td class="thead-tbl-status">
                                                <a class="note implicit hide" href="/member/fresh/deliver_address.htm?type=home&amp;action=deliver_address_mgr&amp;_tb_token_=ikerv29ISLhu&amp;event_submit_do_update_default_addr=submit&amp;id=302440988">
                                                    设为默认</a>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>--%>
                                </div>
                            </div>
                            <span class="mytaobao-rc-bt"><span></span></span>
                        </div>
                    </div>
                    <!-- end col-main -->
                    <div class="col-sub" id="J_Col_Sub">
                        <%=new msBsc.WebUi.Code.QtHtmlGet().GetCustomMenu()%>
                    </div>
                                <div style="clear:both;"></div>
                </div>
                <!-- end mytaobao-panel -->
            </div>
        </div>
        <!-- template -->
        <textarea id="list_temp" style="display: none;">  
        
        <table border="0" cellspacing="0" cellpadding="0" class="tbl-main">
            <colgroup>
                <col class="col-area">
                <col class="col-address">
                <col class="col-man">
                <col class="col-postcode">
                <col class="col-phone">
                <col class="col-actions">
            </colgroup>
            <tbody >
            <tr class="thead-tbl-grade">
                <th>
                    所在地区
                </th>
                <th>
                    详细地址
                </th>
                <th>
                    收货人
                </th>
                <th>
                    邮编
                </th>
                <th>
                    电话/手机
                </th>
                <th>
                    操作
                </th>
                <th>
                </th>
            </tr>   
            {{# for(var i = 0, len = d.rows.length; i < len; i++){ }}
            <tr class="thead-tbl-address  {{# if(d.rows[i].IS_DEFAULT=='True'){ }} address-default {{# }else{ }}   {{#}}}">
                <td>
                    {{ d.rows[i].ZONE_DESC }}
                </td>
                <td>
                    {{ d.rows[i].STREET_ADDRESS }}
                </td>
                <td>
                    {{ d.rows[i].RECEIPT_NME }}
                </td>
                <td>
                     {{ d.rows[i].ZIP_CODE }}
                </td>
                <td>
                      {{ d.rows[i].PHONE_NO }}
                </td>
                <td>
                    <a href="javascript:void(0);" onclick="doedit('{{ d.rows[i].RECE_ADDRESS_ID }}');">修改</a> | <a href="javascript:void(0);"  onclick="dodelete('{{ d.rows[i].RECE_ADDRESS_ID }}');" class="del">删除</a>
                </td>
                <td class="thead-tbl-status">
                    {{# if(d.rows[i].IS_DEFAULT=='True'){ }} <span class="note">默认地址</span> {{# }else{ }} <a class="note implicit hide" href="javascript:void(0);" onclick="dosetdefault('{{ d.rows[i].RECE_ADDRESS_ID }}');">
                        设为默认</a>  {{#}}}
                    
                </td>
            </tr> 
            {{# } }}      
                </tbody>
            </table>
        </textarea>
        <%=new msBsc.WebUi.Code.QtHtmlGet().GetFloorHtml()%>
    </div>
    <!-- foot script -->
</body>
</html>
